﻿namespace A14_EX01_5
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    public class Program
    {
        public static void Main()
        {
            LexicographicAnalyze();
        }

        public static void LexicographicAnalyze()
        {
            System.Console.WriteLine("Please enter a string:");
            string inputFromUser = System.Console.ReadLine();

            uint numOfLowerCaseEnglishLetters = 0, 
                numOfUpperCaseEnglishLetters = 0, 
                numOfDigits = 0, 
                numOfSpaces = 0;

            foreach (char letter in inputFromUser)
            {
                if (letter.CompareTo(' ') == 0)
                {
                    ++numOfSpaces;
                }
                else if (letter >= '0' && letter <= '9')
                {
                    ++numOfDigits;
                }
                else if (letter >= 'a' && letter <= 'z')
                {
                    ++numOfLowerCaseEnglishLetters;
                }
                else if (letter >= 'A' && letter <= 'Z')
                {
                    ++numOfUpperCaseEnglishLetters;
                }
            }

            string outputMessage = string.Format(
@"This string has {0} lower case letters 
                {1} upper case letters
                {2} digits 
            and {3} spaces.
Thank you, Goodbye!", numOfLowerCaseEnglishLetters, numOfUpperCaseEnglishLetters, numOfDigits, numOfSpaces);

            System.Console.WriteLine(outputMessage);
        }
    }
}
